﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using WPF_QC.DataService;
using GalaSoft.MvvmLight.Messaging;



namespace WPF_QC.QA_ViewModel
{
    public class MainWindowViewModel:ViewModelBase
    {
        public MainWindowViewModel()
        {
            

        }

	    /*
        private bool _isbusy;
        public bool IsBusy
        {
            get
            {
                return _isbusy;
            }

            set
            {
                _isbusy = value;
                RaisePropertyChanged("IsBusy");
            }
        }
        */

        private IPageViewModel _currentPageViewModel;
        public IPageViewModel CurrentPageViewModel
        {
            get
            {
                return _currentPageViewModel;
            }
            set
            {
                if (_currentPageViewModel != value)
                {
                    _currentPageViewModel = value;
                    RaisePropertyChanged("CurrentPageViewModel");
                }
            }
        }

        private ICommand _PageParameterCommand;
        public ICommand PageParameterCommand
        {
            get
            {
                if (_PageParameterCommand == null)
                {

                    _PageParameterCommand = new RelayCommand<PageTitles>(
                        p => ExecutePageParameterCommand((PageTitles)p),
                        CanExecutePageParameterCommand);
                 }

                return _PageParameterCommand;
            }
        }

        private bool CanExecutePageParameterCommand(PageTitles pageTitle)
        {
            return true;
        }

        private void ExecutePageParameterCommand(PageTitles pageTitle)
        {
            Messenger.Default.Send(new NavigationMenu(pageTitle));
        }
     
    }
}
